package com.ihr360.utils;

import com.ihr360.commons.model.type.BenefitsPayer;

/**
 * @author Stone.Shi
 * @description
 * @date 2018-02-11 16:35:05.
 */
public class SIHFUtil {

    public static BenefitsPayer getHeaderCellType(String cellId) {
        if (cellId.endsWith(SIHFConstants.SUBFIX_HEADER_CELL_ID_PERSON)) {
            return BenefitsPayer.PERSON;
        } else {
            return BenefitsPayer.COMPANY;
        }
    }

    public static String getHeaderCellId(String typeCode, BenefitsPayer payer) {
        if (payer == BenefitsPayer.PERSON) {
            return typeCode + SIHFConstants.SUBFIX_HEADER_CELL_ID_PERSON;
        } else {
            return typeCode + SIHFConstants.SUBFIX_HEADER_CELL_ID_COMPANY;
        }
    }

    public static String getHeaderCellName(String typeName, BenefitsPayer payer) {
        if (payer == BenefitsPayer.PERSON) {
            return typeName + SIHFConstants.SUBFIX_HEADER_CELL_NAME_PERSON;
        } else {
            return typeName + SIHFConstants.SUBFIX_HEADER_CELL_NAME_COMPANY;
        }
    }
}
